Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callbacks to text selection events of TextBox #5366

Merged
merged 8 commits into from
Aug 25, 2022

Conversation

nekodex
Copy link
Contributor

@nekodex nekodex commented Aug 19, 2022

Will be used for adding audio feedback to text selection in lazer

osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
Comment on lines 1575 to 1577
if (userEvent) OnImeComposition(newComposition, removeCount, addCount, oldStart != selectionStart || oldEnd != selectionEnd);

onTextSelectionChanged(newSelectionLength > 0 ? TextSelectionType.Character : TextSelectionType.Deselect);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is valid, as IME input is quite different from regular text input. I'd rather add newSelectionLength (or textSelected) to OnImeComposition.

With the osu!-side PR, this currently produces sounds for both OnImeComposition and OnTextSelectionChanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, I'll re-check the behaviour with IME.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been removed.

osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
@nekodex nekodex self-assigned this Aug 24, 2022
@peppy peppy enabled auto-merge August 25, 2022 09:23
@peppy peppy merged commit ecdec63 into ppy:master Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants